import Vue from 'vue'
import Router from 'vue-router'
import Donate from './views/Donate.vue'
Vue.use(Router)

export default new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  routes: [
    {
      path: '/',
      component: () => import(/* webpackChunkName: "about" */ './views/login/login.vue')
    },
    {
        path: '/login',
        name: 'login',
        component: () => import(/* webpackChunkName: "about" */ './views/login/login.vue')
    }, {
        path: '/register',
        name: 'register',
        component: () => import(/* webpackChunkName: "about" */ './views/login/register.vue')
     },
    {
        path: '/index',
        name: 'index',
        redirect:'/donate/index'
    },
    {
        path: '/donate',
        name: 'donate',
        component: Donate,
        children :[
            {path: 'index',name: 'index',component: () => import( './views/donate/Index.vue')},
            {path: 'user/view',component: () => import( './views/donate/user/View.vue')},
            {path: 'user/edit',component: () => import( './views/donate/user/Edit.vue')},

            {path: 'post/index',component: () => import( './views/donate/post/Index.vue')},
            {path: 'post/edit',component: () => import( './views/donate/post/Edit.vue')},
            {path: 'post/myPost',component: () => import( './views/donate/post/MyPost.vue')},
            {path: 'post/view',name:"donate_post_view",component: () => import( './views/donate/post/View.vue')},

            {path: 'help/index',component: () => import( './views/donate/help/Index.vue')},
            {path: 'help/apply',name:'donate_help_apply',component: () => import( './views/donate/help/Apply.vue')},
            {path: 'help/myApply',component: () => import( './views/donate/help/MyApply.vue')},
            {path: 'help/view',name:'donate_help_view',component: () => import( './views/donate/help/View.vue')},

            {path: 'donate/edit',name:'donate_donate_edit',component: () => import( './views/donate/donate/Edit.vue')},
            {path: 'donate/view',name:'donate_donate_view',component: () => import( './views/donate/donate/View.vue')},
            {path: 'donate/myList',name:'donate_donate_myList',component: () => import( './views/donate/donate/MyList.vue')},
            {path: 'donate/rank',name:'donate_donate_rank',component: () => import( './views/donate/donate/Rank.vue')},

        ]
     },
      {
          path: '/manage/index',
          name: 'manage',
          component: () => import(/* webpackChunkName: "about" */ './views/manage/Index')
      },
      {
          path: '/manage/user/list',
          component: () => import(/* webpackChunkName: "about" */ './views/manage/system/user/List')
      }
  ]
})
